package com.yiren.manager.utils;

import java.util.HashMap;
import java.util.Map;

import com.yiren.manager.domain.TokenForm;

/**
 * 
 * 系统缓存
 * 
 * @author 冯胜德 
 */
public class SystemCache {

	private static Map<String, TokenForm> token_map;

	public static void addToken(String token, TokenForm form) {
		if (token_map == null)
			token_map = new HashMap<String, TokenForm>();

		token_map.put(token, form);
	}

	public static void removeToken(String token) {
		if(token_map.containsKey(token))
			token_map.remove(token);
	}

	public static TokenForm getToken(String key) {
		if (token_map == null)
			return null;
		return token_map.get(key);
	}
}
